#import "ee/security_dashboard/graphql/fragments/vulnerability_severities_count.fragment.graphql"

query vulnerabilitySeveritiesCount(
  $fullPath: ID = ""
  $projectId: [ID!]
  $severity: [VulnerabilitySeverity!]
  $reportType: [VulnerabilityReportType!]
  $scanner: [String!]
  $state: [VulnerabilityState!]
  $scannerId: [VulnerabilitiesScannerID!]
  $hasIssues: Boolean
  $hasResolution: Boolean
  $clusterAgentId: [ClustersAgentID!]
  $image: [String!]
  $isGroup: Boolean = false
  $isProject: Boolean = false
  $isInstance: Boolean = false
) {
  instance: instanceSecurityDashboard @include(if: $isInstance) {
    vulnerabilitySeveritiesCount(
      projectId: $projectId
      severity: $severity
      reportType: $reportType
      scanner: $scanner
      state: $state
      scannerId: $scannerId
      hasIssues: $hasIssues
      hasResolution: $hasResolution
    ) {
      ...VulnerabilitySeveritiesCount
    }
  }
  group(fullPath: $fullPath) @include(if: $isGroup) {
    id
    vulnerabilitySeveritiesCount(
      projectId: $projectId
      severity: $severity
      reportType: $reportType
      scanner: $scanner
      state: $state
      scannerId: $scannerId
      hasIssues: $hasIssues
      hasResolution: $hasResolution
    ) {
      ...VulnerabilitySeveritiesCount
    }
  }
  project(fullPath: $fullPath) @include(if: $isProject) {
    id
    vulnerabilitySeveritiesCount(
      severity: $severity
      reportType: $reportType
      scanner: $scanner
      state: $state
      scannerId: $scannerId
      hasIssues: $hasIssues
      hasResolution: $hasResolution
      clusterAgentId: $clusterAgentId
      image: $image
    ) {
      ...VulnerabilitySeveritiesCount
    }
  }
}
